import request from '@/utils/request'

const api = {
  getPermissionUrl: '/comdesk_permission/get_permission',
  getPermByUseridUrl: '/comdesk_permission/get_perm_by_userid',
  findPermByRoleUrl: '/comdesk_permission/find_perm_by_role',
}

export async function getPermissionApi(params: Map<string, any>) {
  const res = await request({
    url: api.getPermissionUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function getPermByUseridApi(params: Map<string, any>) {
  const res = await request({
    url: api.getPermByUseridUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function findPermByRoleApi(params: Map<string, any>) {
  const res = await request({
    url: api.findPermByRoleUrl,
    method: 'get',
    params: params,
  })
  return res
}
